/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ufpe.cin.ads;

public class OperationalLaws {

    public static void calculateUtilizationLaw() {
        System.out.print("Enter Xi: ");
        double Xi = InputHelper.nextDouble();
        System.out.print("Enter Si: ");
        double Si = InputHelper.nextDouble();

        double Ui = Xi * Si;
        System.out.println("Ui = " + Ui);
    }

    public static void calculateForcedFlowLaw() {
        System.out.print("Enter X: ");
        double X = InputHelper.nextDouble();
        System.out.print("Enter Vi: ");
        double Vi = InputHelper.nextDouble();

        double Xi = X * Vi;
        System.out.println("Xi = " + Xi);
    }

    public static void calculateLittlesLaw() {
        System.out.print("Enter Xi: ");
        double Xi = InputHelper.nextDouble();
        System.out.print("Enter Ri: ");
        double Ri = InputHelper.nextDouble();

        double Qi = Xi * Ri;
        System.out.println("Qi = " + Qi);
    }

    public static void calculateGeneralResponseTimeLaw() {
        double R = 0;

        System.out.print("Enter M: ");
        int M = InputHelper.nextInt();
        for (int i = 1; i <= M; i++) {
            System.out.print("Enter R" + i + ": ");
            double Ri = InputHelper.nextDouble();
            System.out.print("Enter V" + i + ": ");
            double Vi = InputHelper.nextDouble();

            R += Ri * Vi;
        }

        System.out.println("R = " + R);
    }

    public static void calculateInteractiveResponseTimeLaw() {
        System.out.print("Enter N: ");
        double N = InputHelper.nextDouble();
        System.out.print("Enter X: ");
        double X = InputHelper.nextDouble();
        System.out.print("Enter Z: ");
        double Z = InputHelper.nextDouble();

        double R = N / X - Z;
        System.out.println("R = " + R);
    }

    public static void calculateAsymptoticBoundsLaw() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
}
